package com.jida.tijian.service;

import com.jida.tijian.dto.CheckitemRequestDto;
import com.jida.tijian.dto.CheckitemResponseDto;
import com.jida.tijian.mapper.CheckitemdetailedMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CheckitemDetailedServiceImpl implements CheckitemDetailedService {

    @Autowired//操作数据库
    CheckitemdetailedMapper checkitemdetailedMapper;

    @Override
    public List<CheckitemResponseDto> checkitemDetailedList(CheckitemRequestDto checkitemRequestDto){
        //返回给前端 接收控制层的参数
        System.out.println("service");
        //调用数据库sql语句
        List<CheckitemResponseDto> result =  checkitemdetailedMapper.checkitemDetailedList(checkitemRequestDto);
        for (int i = 0; i < result.size(); i++) {
            System.out.println(result.get(i).getCiName()+" "+result.get(i).getName());
        }
        return checkitemdetailedMapper.checkitemDetailedList(checkitemRequestDto);
    }
}
